package data.nanjing.expo.models.domain;

import data.nanjing.expo.common.Util;
import org.springframework.beans.factory.annotation.Value;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class FileManage {

    private int id;
    private String belong;
    private int belongId;
    private int userId;
    private String fileName;
    private String fileKey;
    private String fileType;

    private String finalPath;  //文件的实际地址

    @Override
    public String toString() {
        return "FileManage{" +
                "id=" + id +
                ", belong='" + belong + '\'' +
                ", belongId=" + belongId +
                ", userId=" + userId +
                ", fileName='" + fileName + '\'' +
                ", fileKey='" + fileKey + '\'' +
                ", fileType='" + fileType + '\'' +
                '}';
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBelong() {
        return belong;
    }

    public void setBelong(String belong) {
        this.belong = belong;
    }

    public int getBelongId() {
        return belongId;
    }

    public void setBelongId(int belongId) {
        this.belongId = belongId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileKey() {
        return fileKey;
    }

    public void setFileKey(String fileKey) {
        this.fileKey = fileKey;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFinalPath() {
        return Util.getFinalFilePath(fileKey);
    }
}
